from ronglian_sms_sdk import SmsSDK


class SmsUtil:
    __instance = None

    def __new__(cls, *args, **kwargs):
        if not cls.__instance:
            cls.__instance = super().__new__(cls, *args, **kwargs)
            cls.smsSdk = SmsSDK(accId='8aaf07087dc23905017dc79400e80213',
                                accToken='0643597830204813b57298aec41013f1',
                                appId='8a216da87dc23fe1017dc794cc2501e1')
        return cls.__instance

    def send_message(self, mobile='15506373808', tid='1', code='1234'):
        self.smsSdk.sendMessage(tid=tid, mobile=mobile, datas=(code, 5))
